import request from '@/api/axios';
import Writerequest from '@/api/writeAxios';
import type { LoginData ,LoginResult } from '@/api/type';

//登陆
export function Login(data: LoginData): Promise<LoginResult<any>> {
  return request({
    url: 'api/RBAC/Login',
    method: 'post',
    data:data
  });
}
import type { MenuData ,MenuResult } from '@/api/type';
//菜单
export function GetMenu(): Promise<MenuResult> {
  return request({
    url: 'api/RBAC/Getmenu',
    method: 'get'
  });
}
//角色
import type { RoleResult } from '@/api/type';
export function GetRole(): Promise<RoleResult> { 
 return request({
   url: 'api/RBAC/GerRole',
   method: 'get'
 });
}
//菜单判断
import type { GetMenuseTimeate } from '@/api/type';
export function GetestimateMenu(data:any):Promise<GetMenuseTimeate> {
  return request({
    url: 'api/RBAC/GetRoleMenu',
    method: 'post',
    data: data
  });
}
//菜单判断

export function GetestimateMenu2(data:any):Promise<any> {
  return request({
    url: 'api/RBAC/GetRoleMenu2',
    method: 'post',
    data: data
  });
}
//用户
export function GetUser(): Promise<any> {
  return request({
    url: 'api/RBAC/GetUsre',
    method: 'post',
  });
}

//部门
export function GetDepartment(): Promise<any> {
  return request({
    url: 'api/RBAC/GetDep',
    method: 'get',
  });
}
//用户添加
export function AddUser(data:any): Promise<any> {
  return Writerequest({
    url: 'api/Categorys/CreateUser',
    method: 'post',
    data: data
  });
}
//权限的添加
export function AddPermission(data:any): Promise<any> {
  return Writerequest({
    url: 'api/Categorys/AddMenu',
    method: 'post',
    data: data
  });
}
//库架的添加
export function addGoods(data: any): Promise<any> { 
    return Writerequest({
    url: 'api/BasicData/CreateShelf',
    method: 'post',
    data: data
  });
}
//货架的显示
export function GoodsSHow(isnoGoods: any): Promise<any> { 
    return request({
    url: 'api/BasicData/GetShelfList',
    method: 'get',
    params: isnoGoods
  });
}
//库区
export function reservoirSHow(form: any): Promise<any> { 
    return request({
    url: 'api/BasicData/GetStorageAreaList',
    method: 'get',
    params: form
  });
}
//货架添加
export function goodsshelfAdd(data: any): Promise<any> { 
    return Writerequest({
    url: 'api/BasicData/CreateWareHouse',
    method: 'post',
    data: data
  });
}
//货架显示
export function goodsshelfShow(isnoGoods: any): Promise<any> { 
    return request({
    url: 'api/BasicData/GetWareHouseList',
    method: 'get',
    params: isnoGoods
  });
}
//物资分类
export function supplies(): Promise<any> { 
      return request({
    url: 'api/Materials/GetCategory',
    method: 'get',
 
  });
}
//物资分类添加
export function suppliesAdd(data: any): Promise<any> { 
    return Writerequest({
    url: 'api/Categorys/CreateCategory',
    method: 'post',
    data: data
  });
}
//物资分类删除
export function suppliesDel(data: any): Promise<any> { 
    return Writerequest({
    url: 'api/Categorys/UpdateCategory',
    method: 'post',
    data: data
  });
}
//物资分类
export function suppliesshow(data: any): Promise<any> { 
    return Writerequest({
    url: 'api/Categorys/DleteCategory',
    method: 'post',
    data: data
  });
}
//物资管理
//物资分类显示
export function materialsmanagementshow(data:any): Promise<any> { 
    return request({
    url: 'api/Materials/GetMaterial',
    method: 'get',
    params:data
  });
}
//物资管理添加
export function suppliesadd(data: any): Promise<any> { 
    return Writerequest({
    url: 'api/Materials/CreateMaterial',
    method: 'post',
    data: data
  });
}
//物资管理查询
export function supplieslook(data: any): Promise<any> { 
    return Writerequest({
    url: 'api/Materials/UpdateMaterial',
    method: 'post',
    data: data
  });
}
//物资管理删除
export function suppliesdel(data: any): Promise<any> { 
    return Writerequest({
    url: 'api/Materials/DleteMaterial',
    method: 'post',
    data: data
  });
}
